<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let str = 'apple banana pear'
        console.log(str.indexOf('banana'));
        if(str.indexOf('banana') !== -1){
            alert(true)
        }else{
            alert(false)
        }
    </script>
</head>
<body>
    
</body>
</html>